package com.whut.utils;

import lombok.Data;
import org.jfree.chart.StandardChartTheme;

import java.awt.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

/**
 * @author ：xiaojun
 * @date ：Created in 2021/3/29 20:09
 * @description：样式工具类
 * @modified By：
 * @version: $
 */
@Data
public class GlobalWordTheme {
    public static final int WIDTH = 718;
    public static final int HEIGHT = 468;
    private static StandardChartTheme standardChartTheme;

    public static final DateFormat unFormatYMD = new SimpleDateFormat("yyyyMMddhhmmss");
    public static final DateFormat unFormatYear = new SimpleDateFormat("yyyy");
    public static final DateFormat unFormatMonth = new SimpleDateFormat("MM");
    public static final DateFormat unFormatDay = new SimpleDateFormat("dd");

    public static StandardChartTheme getStandardChartThemeInstance(){
        if(standardChartTheme==null){
            standardChartTheme=new StandardChartTheme("CN");
            //设置标题字体
            standardChartTheme.setExtraLargeFont(new Font("隶书", Font.BOLD, 20));
            //设置图例的字体
            standardChartTheme.setRegularFont(new Font("宋书", Font.PLAIN, 15));
            //设置轴向的字体
            standardChartTheme.setLargeFont(new Font("宋书", Font.PLAIN, 15));
        }
        return standardChartTheme;
    }

}
